package com.fund.api.client;

import com.fund.api.entity.ProductVO;
import com.fund.common.pojo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;

@FeignClient("product-service")
public interface ProductClient {
    @GetMapping("/product")
    public Result<ProductVO> getById(@RequestParam Long id) ;

    @PostMapping("/product/worth")
    public Result<Boolean> updateWorth();

    /**
     * 根据id列表查询产品净值
     * @param idList
     * @return
     */
    @GetMapping("/product/worth")
    public Result<HashMap<Long, BigDecimal>> getNetWorthByIds(List<Long> idList);
}
